/*
 * @(#)Column.java	1.0 2000/12/19
 *
 * Copyright 2000 Thomas Barnekow. All Rights Reserved.
 *
 * This software is the proprietary information of Thomas Barnekow.
 * Use is subject to license terms.
 */

package tb.provider.jdbc;

import java.sql.*;

import tb.provider.*;

/**
 * Column metadata.
 *
 * @author Thomas Barnekow
 * @version 1.0
 */
public class Column extends AbstractMetaObject {

  private String m_name;
  private int m_dataType;
  private String m_typeName;
  private int m_columnSize;
  private int m_decimalDigits;
  private int m_nullable;
  private String m_remarks;
  private String m_defaultValue;

  Column(String name, Table table) {
    super(name, table);
  }

  public Connection getConnection() {
    return ((Table) getContainer()).getConnection();
  }

  public final String getName() {
    return getId().toString();
  }

  final void setDataType(int value) {
    m_dataType = value;
  }

  public final int getDataType() {
    return m_dataType;
  }

  final void setTypeName(String value) {
    m_typeName = value;
  }

  public final String getTypeName() {
    return m_typeName;
  }

  final void setColumnSize(int value) {
    m_columnSize = value;
  }

  public final int getColumnSize() {
    return m_columnSize;
  }

  final void setDecimalDigits(int value) {
    m_decimalDigits = value;
  }

  public final int getDecimalDigits() {
    return m_decimalDigits;
  }

  final void setNullable(int value) {
    m_nullable = value;
  }

  public final int getNullable() {
    return m_nullable;
  }

  final void setRemarks(String value) {
    m_remarks = value;
  }

  public final String getRemarks() {
    return m_remarks;
  }

  final void setDefaultValue(String value) {
    m_defaultValue = value;
  }

  public final String getDefaultValue() {
    return m_defaultValue;
  }
}